<?php

require_once('../../config/maptrick.conf.php');
require_once(SITE_ROOT . 'lib/Session.php');
require_once(SITE_ROOT . 'lib/SmartyMaptrick.class.php');
require_once(SITE_ROOT . 'class/logic/LogicHoC.class.php');

$logic = LogicHoC::getInstance();
$smarty = new SmartyMaptrick();

if (isset($_GET['country'])) {
	$countryID = $_GET['country'];
}
else $countryID = 0;

if (isset($_GET['division'])) {
	$divisionID = $_GET['division'];
}
else $divisionID = 0;

if (isset($_GET['site'])) {
	$site = $_GET['site'];
}
else $site = "hoc";

$smarty->assign_by_ref('leagues', $logic->getLeagues($countryID, $divisionID));

if ($site == "import") {
	$smarty->display('hoc/select_leagues_import.tpl');
}
else $smarty->display('hoc/select_leagues.tpl');

?>